package com.byq.mm.gateway;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import com.byq.mm.abstractx.device.Device;
import com.byq.mm.home.device.adapter.LocalRemoteBridge;
import com.byq.mm.smartlib.application.MySmartApplication;
import com.tc.gateway.HomeApplication;
import com.tc.gateway.ProxyException;

import android.app.Application;
import android.widget.Toast;

public class AssistanceApplication extends MySmartApplication {
	LocalRemoteBridge bridge;
	AndroidHomeApplication homeApplication;
	public AndroidHomeApplication getHomeApplication(){
		return homeApplication;
	}
	@Override
	public void onCreate() {

		super.onCreate();
		homeApplication = new AndroidHomeApplication(this.getApplicationContext());
		bridge = new LocalRemoteBridge(homeApplication.getGatewayEngine().getDeviceManager(), this.getAndroidSmartEngine().getCoreEngine());
		try {
			homeApplication.start();
		} catch (Exception e) {

			e.printStackTrace();
			Toast.makeText(this, "cant start application!", Toast.LENGTH_SHORT).show();

		}
		Device d = this.getAndroidSmartEngine().getCoreEngine().getServerDeviceManager().getLocalServerDevice();

		sound.addSound(0, com.byq.mm.smartlib.R.raw.chimes);
	}

	@Override
	public Device getLocalServerDevice() {


		return new Device();
	}

}
